package balmysundaycandy.more.low.level.logger.impl;

import java.util.logging.Logger;

import balmysundaycandy.more.low.level.logger.ProtocolBufferLogger;
import balmysundaycandy.more.low.level.logger.ProtocolBufferLogContents;

/**
 * logging by logger.
 * 
 * @author marblejenka
 * 
 */
public class SimpleLogger implements ProtocolBufferLogger {

	Logger logger = Logger.getLogger(SimpleLogger.class.getSimpleName());

	@Override
	public boolean log(String message) {
		logger.info(message);
		return true;
	}

	@Override
	public boolean log(ProtocolBufferLogContents logContents) {
		if (logContents == null) {
			throw new NullPointerException("logcontens is null.");
		}

		return log(logContents.toString());
	}

}
